var HappyPack = require('happypack')
var os = require('os')
var { resolve } = require('./build.uitls')

var happyThreadPool = HappyPack.ThreadPool({ size: os.cpus().length })
module.exports = {
  output: {
    filename: '[name].dev.js'
  },
  module: {
    rules: [
      {
        test: /\.js$/,
        use: ['happypack/loader?id=happyBabel'],
        include: resolve('./src')
      }
    ]
  },
  plugins: [
    new HappyPack({
      id: 'happyBabel',
      threadPool: happyThreadPool,
      loaders: ['babel-loader?cacheDirectory=true'],
      verbose: true
    })
  ]
}
